<template>
  <div class="waybill__detail__info">
    <div class="top__title">
      <span class="line"></span>
      <span class="text">{{ title }}</span>
    </div>
    <div class="list">
      <div class="item" v-for="(item, index) in list" :key="index">
        <div class="title">{{ item.title }}</div>
        <div class="value" :style="item.valueStyle || {}">{{ item.value }}</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, PropType } from 'vue'
export default defineComponent({
  name: 'waybillDetailInfo',
  props: {
    title: {
      type: String,
      default: () => {
        return ''
      }
    },
    list: {
      type: Array as PropType<{ title: string; value: string; valueStyle?: any }[]>,
      default: () => {
        return []
      }
    }
  }
})
</script>

<style lang="scss" scope>
.waybill__detail__info {
  width: 100%;
  background-color: white;
  box-sizing: border-box;
  padding: 0 10px;
  position: relative;
  margin-bottom: 10px;
  .top__title {
    width: 100%;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: 15px 0;
    border-bottom: 1px solid #ededed;
    margin-bottom: 15px;
    .line {
      width: 3px;
      height: 10px;
      background: #409eff;
      position: absolute;
      left: 0;
      top: 17px;
    }
    .text {
      font-size: 16px;
      font-weight: 500;
      line-height: 16px;
      color: #101736;
    }
  }
  .list {
    .item {
      display: flex;
      justify-content: space-between;
      padding-bottom: 12px;
      line-height: 20px;
      .title {
        font-size: 14px;
        font-weight: 400;
        color: #575c72;
        width: 80px;
      }
      .value {
        width: calc(100% - 90px);
        text-align: right;
        font-size: 14px;
        font-weight: 400;
        color: #101736;
      }
    }
  }
}
</style>
